'use strict';
/**
 * @author aipeli
 * @package midway-crud
 * @date 2022-02-10 23:42:05
 */

/**
 * Log Middleware
 */
async function LogMiddleware(ctx: any, next: any) {
  // 获取配置
  // const config = ctx.app.getConfig();
  // console.log(config);
  // 获取@Provide的对象
  // const xxx_service = await ctx.requestContext.getAsync(xxx_Service);
  // ctx.body = {
  //   code: 1001,
  //   message: '获用户数据成功',
  //   data: await xxx_service.getUser(1),
  // };
  console.log(`[LogMiddleware]中间件执行时间: ${Date.prototype.toJSON()}`);

  await next();
}

export { LogMiddleware };
